package com.ryskoo.permission.permission.domain;

import com.ryskoo.framework.core.bean.BasicPO;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "PMS_PERMISSION")
public class PermissionPO extends BasicPO {
    private static final long serialVersionUID = -935402793660883681L;
    /**
     * 权限名称
     */
    @Column(name = "name", columnDefinition = "varchar", length = 20, nullable = false)
    private String name;
    /**
     * 所属菜单
     */
    @Column(name = "menu_id", columnDefinition = "char", length = 32, nullable = false)
    private String menuId;
    /**
     * 表达式
     */
    @Column(name = "express", columnDefinition = "varchar", length = 50, nullable = false)
    private String express;
    /**
     * 权限类型，默认平台权限
     * 0 - 平台权限
     * 1 - 商户权限
     */
    @Column(name = "type", columnDefinition = "tinyint", length = 2, nullable = false)
    private int type = 0;
    /**
     * 状态
     */
    @Column(name = "state", columnDefinition = "bit", length = 1, nullable = false)
    private boolean state = true;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getExpress() {
        return express;
    }

    public void setExpress(String express) {
        this.express = express;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public boolean isState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return new StringBuffer(super.toString()).append("PermissionPO [name=").append(name)
                .append(", menuId=").append(menuId)
                .append(", express=").append(express)
                .append(", type=").append(type)
                .append(", state=").append(state)
                .append("]").toString();
    }

}
